package com.rran.study.designpattern.behavioral.template;


import com.rran.study.designpattern.behavioral.template.service.PersonAGoShopping;
import com.rran.study.designpattern.behavioral.template.service.PersonBGoShopping;
import com.rran.study.designpattern.behavioral.template.service.PersonCGoShopping;

/**
 * 简单的模板方法模式 通过new对应的子类实现
 * login()和 expressDelivery()为公共方法，其他的方法又子类自定义实现
 */
public class SimpleTemplateApplication {

    public static void main(String[] args) {

        PersonAGoShopping personA = new PersonAGoShopping();
        PersonBGoShopping personB = new PersonBGoShopping();
        PersonCGoShopping personC = new PersonCGoShopping();
        System.out.println("A开始shopping");
        personA.buyGoods();
        System.out.println("===================");

        System.out.println("B开始shopping");
        personB.buyGoods();
        System.out.println("===================");

        System.out.println("C开始shopping");
        personC.buyGoods();
      }
}
